Instructions for members:
Name all files you attach with a string that starts with "Project_20152016_LabonCD_".
Milestone 1: Preliminary design
Design Specifications
There are two phases of operation :
Phase 1
Rotational velocity = 3000 rpm
No need for displacement control
Phase 2
Low rotation speed
Need for highly accurate displacement control
The lab-on-cd system should be as reliable and inexpensive as possible.
Key Functions
Motion System
Displacement control
Conceptual Design Brainstorming
Idea 1
A stepper motor for the low speed phase that requires high accuracy.
A dc motor for the high speed phase.
A) Use of two motors in series.
B) Use of two motors in parallel.
Idea 2
A dc motor for both phases.
Idea 3
A stepper motor for both phases using a transmission system.
A) Gear transmission
B) Belt transmission
Conceptual Design Choice
Advantages
Disadvantages
Idea 1A
Easy to control
Expensive
Stepper is rotated by dc motor
Two motors
Idea 1B
Easy to control
Expensive
Extra moving parts
Idea 2
Cheap Minimum moving parts
Can be expensive.
Idea 3A
Easy to control
Backlash
Extra moving parts
Idea 3B
Easy to control
Slip
Extra moving parts
-Idea 1A is abandoned because, during the high-speed phase , the stepper would be rotated by the DC motor, which is unacceptable.
This could be resolved with the use of a clutch, but that would make the system less reliable.
-Idea 1B is abandoned because it would imply the use of some kind of gearbox.
-Ideas 3A and 3B are abandoned because of the backlash and slip that would occur. That would lessen the accuracy of the system.
-Idea 2 is the cheapest because it requires only a cheap DC motor. Also it requires no extra moving parts and it only requires a sensor
for the measurement of the displacement.
An encoder would be very good choice for such a sensor.
A cheaper alternative would be the use of an optical mouse sensor.
Taking these factors into consideration and the need for minimum cost, we have decided to proceed with the Idea 2, using an optical
mouse sensor.
The optical mouse sensor will be used to measure the angular displacement of the CD. This kind of sensor relative displacement and thus
the error produced is cumulative, so we must take measures to solve this issue.
Mouse Sensor
-Controller
In our case a Rasberry Pi(in addition to a motor) driver will be used to control the system, using the measurements taken from the optical mouse sensor.
-Motor
A cheap DC motor will be used, that can achieve 3000 rpm.
-Housing
The housing will contain the rest of the subsystems and must be as compact as possible.
-CD
The CD will accommodate the samples that are to be tested
Subsystem Detailed Design
-Optical Sensor
Before we decide on a sensor, we must first examine the factors that affect its performance.
Distance from Lens Reference Plane to Surface:
In order to measure correctly the lens reference plane must be placed 2.3-2.5 mm away from the surface. The sensor can work with different values but the readings will not be accurate.
Number of Bits of Motion Data
Most sensors transmit the motion in packets of 8 bits for the x-axis movement and 8 bits for the y-axis movement. These bytes correspond to counts and each count corresponds to 1/DPI of an inch.
RPM:
A high RPM value leads to high linear velocity.
FPS:
The rate at which the mouse sensor takes pictures. Higher FPS mean higher maximum linear velocity.
Radial placement:
The placement of the sensor at a large radius means that every degree of the circular trajectory corresponds to a larger length, thus we can achieve
better resolution. The drawback is that for a specific angular velocity, the linear velocity increases as the radius increases.
The RPM, the maximum FPS and the number of bits of motion data of the mouse lead to the maximum radius, at which the sensor can be placed.
RPM:
A high RPM value leads to high linear velocity. The RPM and the maximum FPS of the mouse lead to the maximum radius, at which the sensor can be placed.
DPI (CPI):
If the sensor moves one inch, then the cursor on the screen will move a number DPI of pixels or it can be said that the sensor will report a CPI number of counts to the computer. If the sensor moves a distance smaller than 1/DPI of an inch, then no counts will be reported to the computer. That means that the DPI influences the resolution of the system, but generally DPIs are rather high.
Number of Bits of Motion Data
Most sensors transmit the motion in packets of 8 bits for the x-axis movement and 8 bits for the y-axis movement. These bytes correspond to counts and each count corresponds to 1/DPI of an inch.
Thus, the Avago S2706 mouse sensor was chosen.
-Controller
The Raspberry PI 2 Model B will be used. The Raspberry Pi cannot provide enough power to control the motor directly, so a L293D
Quadruple Half-H Driver will be used. The Half-H Driver also changes the direction of the rotation of the motor, by automatically changing the polarity of the current.
H Driver
-Motor
DC Motor
Milestone 3: Prototype fabrication
Stepper Motor
At first, we must determine, whether good accuracy can be achieved using this kind of sensor. It is necessary that we calibrate the mouse sensor, so that we can match the sensor data to the trajectory. In order to do that we will use a stepper DC motor. This will allow us to accurately move the CD and get a first idea of the repeatability and accuracy of our measurements. To drive the stepper motor we used a Raspberry Pi, a 12V power supply and a 2H Microstep Driver.
Stepper Motor
DQ420MA 2h Microstep Driver
Base
Stepper set-up
Stepper set-up
Stepper set-up
Using the above assembly we made the stepper motor run for one full revolution, 20 times at 4.17 Rpm and got the following readings:
Angular Displacement (Degrees)
360,80
359,36
357,73
360,81
360,38
360,33
360,14
360,80
361,11
358,93
361,01
359,11
361,29
358,82
357,64
360,37
359,68
361,04
358,76
358,68
With a:
Mean=359,89
Standard Deviation=1,107
DC Motor Control
Now that we know we can achieve very good accuracy, we proceed to fabricate the actual prototype. The set-up, which houses the motor,the sensor and the CD-ROM, can be seen in the following picture.
Electronic Circuit
The 9V battery acts as a power supply, that feeds the Half-H Driver.The driver amplifies the PWM signal coming from the ports of the Raspberry Pi and enables the motor to turn both ways. The direction, in which the motor will rotate, is determined by the PWM signal that is at any time active. The Raspberry Pi also provides the Half-H Driver with a 5V voltage, that is required for internal logic translation and provides the whole circuit with ground. The wiring of the of the electrical and electronic parts can be seen in the following picture.
DC motor set-up wiring
Electronic circuit
PID Controller
A PID control law will be programmed on the Raspberry PI. We must tune the controller and to do that we must determine the gains of the controller. First of all, we increase the Proportional Gain (Kp) until we have achieved a fast enough response. Then, we increase the Derivative Gain (Kd), until the damping of the system is great enough. At last, we increase the Integral Gain (Ki) until we have achieved a fast convergence to the desired position.
Determining Kp
Determining Kd
Determining Ki
Response with final gain values
Python Codes
The following code is used to obtain the relative displacements from a file. Then, the length of the traveled arc is calculated and consequently the angular position.
The following code is used to control the stepper motor. The Driver receives a PWM signal, from Raspberry PI, of a specific frequency(500Hz). Each pulse corresponds to one microstep. The frequency of the pulse dictates the rotation velocity of the Stepper Motor. To achieve more fluid movement we use the Microstep option offered by the Driver(25600 pulse/rev)
The following code is used to control the DC Motor. Specifically, a standard PID control law is applied. After a few tests, we chose a sampling rate of 0.01 sec and a PWM frequency of 100Hz. This is how the code works:
Acquisition of the current position of the disc.
Calculation of the position error.
Calculation of the input voltage.
Selection of the appropriate PWM pin depending on the desirable direction of rotation.
Termination of the programme as soon as the desirable position is achieved.
Results
At the following link, the fully functional prototype can be seen. In this demonstration, we command the CD to turn 20 degrees and the response of the LabonCD can be seen. In the end, the achieved angular position and the elapsed time can be seen. LabonCD_Demonstration References Research Papers 1. http://www.mate.tue.nl/mate/pdfs/7846.pdf
Project Info
Objective:Design a precision motion control system for a state-of-the-art lab-on-CD system
Team Members:
1.Οικονόμου Γεώργιος
2.Τρατράς Νικόλαος
3.Νικολινάκος Ιωάννης
4.Στρατογιαννης Φωτιος
5.Βακάσης Γεράσιμος
Team Contact:
Tratras Nikolaos (nikostratras@yahoo.gr)
Mentor:
Kanakaris Georgios (gkanak84@gmail.com)
Consultants:
Panagiotopoulos Ilias (panagiotopoulos.ilias@gmail.com)
Instructions for members:
Name all files you attach with a string that starts with "Project_20152016_LabonCD_".
Milestone 1: Preliminary design
Design SpecificationsThere are two phases of operation :
- Phase 1
Rotational velocity = 3000 rpmNo need for displacement control
- Phase 2
Low rotation speedNeed for highly accurate displacement control
The lab-on-cd system should be as reliable and inexpensive as possible.
Key Functions
Conceptual Design Brainstorming
Idea 1A stepper motor for the low speed phase that requires high accuracy.
A dc motor for the high speed phase.
A) Use of two motors in series.
B) Use of two motors in parallel.
Idea 2
A dc motor for both phases.
Idea 3
A stepper motor for both phases using a transmission system.
A) Gear transmission
B) Belt transmission
Conceptual Design Choice
Stepper is rotated by dc motor
Two motors
Extra moving parts
Minimum moving parts
Extra moving parts
Extra moving parts
-Idea 1A is abandoned because, during the high-speed phase , the stepper would be rotated by the DC motor, which is unacceptable.
This could be resolved with the use of a clutch, but that would make the system less reliable.
-Idea 1B is abandoned because it would imply the use of some kind of gearbox.
-Ideas 3A and 3B are abandoned because of the backlash and slip that would occur. That would lessen the accuracy of the system.
-Idea 2 is the cheapest because it requires only a cheap DC motor. Also it requires no extra moving parts and it only requires a sensor
for the measurement of the displacement.
An encoder would be very good choice for such a sensor.
A cheaper alternative would be the use of an optical mouse sensor.
Taking these factors into consideration and the need for minimum cost, we have decided to proceed with the Idea 2, using an optical
mouse sensor.
Milestone 2: Detailed design
Subsystems & Task assignment
-Optical Sensor
The optical mouse sensor will be used to measure the angular displacement of the CD. This kind of sensor relative displacement and thus
the error produced is cumulative, so we must take measures to solve this issue.
-Controller
In our case a Rasberry Pi(in addition to a motor) driver will be used to control the system, using the measurements taken from the optical mouse sensor.
-Motor
A cheap DC motor will be used, that can achieve 3000 rpm.
-Housing
The housing will contain the rest of the subsystems and must be as compact as possible.
-CD
The CD will accommodate the samples that are to be tested
Subsystem Detailed Design
-Optical Sensor
Before we decide on a sensor, we must first examine the factors that affect its performance.
Distance from Lens Reference Plane to Surface:
In order to measure correctly the lens reference plane must be placed 2.3-2.5 mm away from the surface. The sensor can work with different values but the readings will not be accurate.
Number of Bits of Motion Data
Most sensors transmit the motion in packets of 8 bits for the x-axis movement and 8 bits for the y-axis movement. These bytes correspond to counts and each count corresponds to 1/DPI of an inch.
RPM:
A high RPM value leads to high linear velocity.
FPS:
The rate at which the mouse sensor takes pictures. Higher FPS mean higher maximum linear velocity.
Radial placement:
The placement of the sensor at a large radius means that every degree of the circular trajectory corresponds to a larger length, thus we can achieve
better resolution. The drawback is that for a specific angular velocity, the linear velocity increases as the radius increases.
The RPM, the maximum FPS and the number of bits of motion data of the mouse lead to the maximum radius, at which the sensor can be placed.
RPM:
A high RPM value leads to high linear velocity. The RPM and the maximum FPS of the mouse lead to the maximum radius, at which the sensor can be placed.
DPI (CPI):
If the sensor moves one inch, then the cursor on the screen will move a number DPI of pixels or it can be said that the sensor will report a CPI number of counts to the computer. If the sensor moves a distance smaller than 1/DPI of an inch, then no counts will be reported to the computer. That means that the DPI influences the resolution of the system, but generally DPIs are rather high.
Number of Bits of Motion Data
Most sensors transmit the motion in packets of 8 bits for the x-axis movement and 8 bits for the y-axis movement. These bytes correspond to counts and each count corresponds to 1/DPI of an inch.
Thus, the Avago S2706 mouse sensor was chosen.
-Controller
The Raspberry PI 2 Model B will be used. The Raspberry Pi cannot provide enough power to control the motor directly, so a L293D
Quadruple Half-H Driver will be used. The Half-H Driver also changes the direction of the rotation of the motor, by automatically changing the polarity of the current.
-Motor
Milestone 3: Prototype fabrication
Stepper Motor
At first, we must determine, whether good accuracy can be achieved using this kind of sensor. It is necessary that we calibrate the mouse sensor, so that we can match the sensor data to the trajectory. In order to do that we will use a stepper DC motor. This will allow us to accurately move the CD and get a first idea of the repeatability and accuracy of our measurements. To drive the stepper motor we used a Raspberry Pi, a 12V power supply and a 2H Microstep Driver.
Using the above assembly we made the stepper motor run for one full revolution, 20 times at 4.17 Rpm and got the following readings:
(Degrees)
With a:
Mean=359,89
Standard Deviation=1,107
DC Motor Control
Now that we know we can achieve very good accuracy, we proceed to fabricate the actual prototype. The set-up, which houses the motor,the sensor and the CD-ROM, can be seen in the following picture.
Electronic Circuit
The 9V battery acts as a power supply, that feeds the Half-H Driver.The driver amplifies the PWM signal coming from the ports of the Raspberry Pi and enables the motor to turn both ways. The direction, in which the motor will rotate, is determined by the PWM signal that is at any time active. The Raspberry Pi also provides the Half-H Driver with a 5V voltage, that is required for internal logic translation and provides the whole circuit with ground. The wiring of the of the electrical and electronic parts can be seen in the following picture.
PID Controller
A PID control law will be programmed on the Raspberry PI. We must tune the controller and to do that we must determine the gains of the controller. First of all, we increase the Proportional Gain (Kp) until we have achieved a fast enough response. Then, we increase the Derivative Gain (Kd), until the damping of the system is great enough. At last, we increase the Integral Gain (Ki) until we have achieved a fast convergence to the desired position.
Python Codes
The following code is used to obtain the relative displacements from a file. Then, the length of the traveled arc is calculated and consequently the angular position.
The following code is used to control the stepper motor. The Driver receives a PWM signal, from Raspberry PI, of a specific frequency(500Hz). Each pulse corresponds to one microstep. The frequency of the pulse dictates the rotation velocity of the Stepper Motor. To achieve more fluid movement we use the Microstep option offered by the Driver(25600 pulse/rev)
The following code is used to control the DC Motor. Specifically, a standard PID control law is applied. After a few tests, we chose a sampling rate of 0.01 sec and a PWM frequency of 100Hz. This is how the code works:
Results
At the following link, the fully functional prototype can be seen. In this demonstration, we command the CD to turn 20 degrees and the response of the LabonCD can be seen. In the end, the achieved angular position and the elapsed time can be seen.
LabonCD_Demonstration
References
Research Papers
1. http://www.mate.tue.nl/mate/pdfs/7846.pdf
2 .http://ac.els-cdn.com/S0924424709003483/1-s2.0-S0924424709003483-main.pdf?_tid=f3afb99a-b930-11e5-8862-00000aacb361&acdnat=1452605740_49aa465afecae4b635414919d0c2b367
Technical Documentation
1. http://www.ti.com/lit/ds/symlink/l293.pdf
2. http://www.wantmotor.com/ProductsView.asp?id=273&pid=82
3. http://grobotronics.com/images/datasheets/T010160_DCmotor6_9V.pdf
(c) 2015 Department of Mechanical Engineering, National Technical University of Athens.